import Router from "@koa/router";
import { UserController } from "../controllers/user.controller";
import { LoginRequestSchema } from "../validators/user.validator";
import { validateBody } from "../middleware/validation";

const authRouter = new Router({
  prefix: "/api/auth",
});

/**
 * 登录
 */
authRouter.post(
  "/login",
  validateBody(LoginRequestSchema),
  UserController.login
);

export default authRouter;
